const Router = require('koa-router');
const { default: axios } = require('axios');
var searchRouter = new Router({ prefix: "/search" });
searchRouter.post('/', async (ctx, next) => {
  const { kw, start, count } = ctx.request.body;
  const res = await axios
    .get(`http://wallpaper.apc.360.cn/index.php?c=WallPaper&a=search&start=${start}&count=${count}&kw=${encodeURI(kw)}`);
  ctx.body = res.data;
  await next();
})
module.exports = searchRouter